package server.db;
public class DbConfig {

	public static final int HOST = 0;
	public static final int PORT = 1;
	public static final int USER = 2;
	public static final int PASS = 3;
	public static final int TABLE = 4;

	private static DbConfig instance;

	private String host;
	private String port;
	private String user;
	private String pass;
	private String table;

	static {
		instance = null;
	}

	public static DbConfig getInstance() {
		if (instance == null) {
			instance = new DbConfig();
		}
		return instance;
	}

	private DbConfig() {

	}

	public void setParams(String[] params) {
		host = params[DbConfig.HOST];
		port = params[DbConfig.PORT];
		user = params[DbConfig.USER];
		pass = params[DbConfig.PASS];
		table = params[DbConfig.TABLE];
	}

	public String getParams(int i) {
		String[] params = new String[] { host, port, user, pass, table };
		return params[i];
	}
}
